﻿#pragma execution_character_set("utf-8")

#ifndef __BASEKIT__
#define __BASEKIT__

#include "RootWindow.h"

extern CAColor4B themeColor;
extern char baseUrl[];
extern CAFont font;
extern float mt;
typedef std::function<void(const string&)> StringCallback;
void sendHttp(CAView* view, const char* url, const std::string& parameters, const StringCallback& callback, const CAHttpRequest::Type httpType=CAHttpRequest::Type::Get, const bool json=false, const bool createAnimation=true);
CANavigationController* getRootWindow();
CAView* getSubview();
CALabel* getLabel(const string& text);
CATextField* getTextField();
void getAlert(CAView* view, const string& message);
CAPickerView* getPicker(CAView* view);
CADatePickerView* getDatePicker(CAView* view, const CADatePickerView::Mode mode=CADatePickerView::Mode::Date);
long size4utf8(const std::string& str);
string obj2str(const char* format, ...);
CAWebView* getWebClient(int threadId, float top, const float height=300);

#endif